import { IFeidaoAiWeappPage } from '@dfeidao/atom-wxapp/interfaces';
import nodejs from '@dfeidao/atom-wxapp/msg/nodejs';
// import { send_msg as url } from '../atom-app/config';
import render from '@dfeidao/atom-wxapp/render/render';
import get_local from '@dfeidao/atom-wxapp/local/get';
import show_loading from '@dfeidao/atom-wxapp/api/interaction/show-loading';
import hide_loading from '@dfeidao/atom-wxapp/api/interaction/hide-loading';
import set_local from '@dfeidao/atom-wxapp/local/set';

export default async function a002(fd: IFeidaoAiWeappPage, ...args: any[]) {
	// todo
	const page_no = get_local(fd, 'page_no');
	try {
		const data = await nodejs<any[]>('app-equipment-find', {
			asc: ['equip_no'],
			page_size: 2,
			page_no
		});
		console.log(data, '-----------最新数据--------------')
		render(fd, {
			data
		})
		set_local(fd, 'list_data', data);
	} catch (error) {
		show_loading('读取数据失败');
		hide_loading();
	}

}
